<template>
<<<<<<< HEAD
  <div>
    <h2>登录</h2>
=======
  <div v-if="type === 'lgn'" class="login-container" key="login">
    <van-nav-bar
      left-text="返回"
      right-text="注册"
      left-arrow
      title="登录"
      @click-left="$router.back()"
      @click-right="onClickRight('reg')"
    />
    <van-form @submit="onSubmit">
      <van-field
        v-model="mobile"
        name="用户名"
        placeholder="请输入手机号码"
        :rules="[
          { required: true, message: '请输入手机号码' },
          { pattern, message: '手机号码格式错误' },
        ]"
      />
      <van-field
        v-model="password"
        type="password"
        name="密码"
        placeholder="请输入密码"
        :rules="[
          { required: true, message: '请输入密码' },
          { pattern: pattern2, message: '长度应在6-12之间' },
        ]"
      />
      <div style="margin: 16px">
        <van-button
          round
          block
          type="primary"
          native-type="submit"
          :disabled="!validate"
          color="#1989fa"
        >
          登录
        </van-button>
      </div>
    </van-form>
  </div>
  <div v-else key="reg">
    <van-nav-bar
      left-text="返回"
      right-text="登录"
      left-arrow
      title="注册"
      @click-left="$router.back()"
      @click-right="onClickRight('lgn')"
    />
    <van-form @submit="onSubmitReg">
      <van-field
        v-model="mobile"
        name="用户名"
        placeholder="请输入手机号码"
        :rules="[
          { required: true, message: '请输入手机号码' },
          { pattern, message: '手机号码格式错误' },
        ]"
      />
      <van-field
        v-model="password"
        type="password"
        name="密码"
        placeholder="请输入密码"
        :rules="[
          { required: true, message: '请输入密码' },
          { pattern: pattern2, message: '长度应在6-12之间' },
        ]"
      />
      <van-field
        v-model="repassword"
        type="password"
        name="确认密码"
        placeholder="确认密码"
        :rules="[
          { required: true, message: '请输入密码' },
          { validator: validater, message: '两次密码不一致' },
        ]"
      />
      <div style="margin: 16px">
        <van-button
          round
          block
          type="primary"
          native-type="submit"
          :disabled="!validate2"
          color="#1989fa"
        >
          注册
        </van-button>
      </div>
    </van-form>
>>>>>>> pc
  </div>
</template>

<script>
export default {

}
</script>

<style>

</style>
